package com.aat.dxfy.concurrent.future;

import java.util.ArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class MainFuture1 {

	public static void main(String[] args) throws InterruptedException, ExecutionException {
		ExecutorService exec = Executors.newCachedThreadPool();//工头
		ArrayList<Future<String>> results = new ArrayList<Future<String>>();
		for(int i = 0 ; i < 100 ;i++){
		    results.add(exec.submit(new TaskCallable(i)));
		}
		exec.shutdown();
	}
	
	

}
